﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace SkillEditor
{
    [Serializable]
    public class SkillEditorData
    {
        public string id;

        //public int timeType;

        //public int timeBouns;

        //public int castTime;

        //public int channelTime;

        //public int[] intervalTime;

        //public int endTime;

        //public int cold;

        public int type;

        //public int targetType;

        //public int targetNum;

        //public int rangeType;

        //public int range;

        //public int cost;

        //public int weight;

        //public string asset;

        //public SkillSpace[] spaces;

        //public Dictionary<string, int> dataInt;

        //public Dictionary<string, string> dataString;

        //public Dictionary<string, bool> dataBool;

        //public Dictionary<string, string> dataEdge;

        public SkillContentData skillContent;

        public SkillEditorData()
        {
            //skillContent = new SkillContentData();
            //intervalTime = new int[0];

            //dataInt = new Dictionary<string, int>();
            //dataString = new Dictionary<string, string>();
            //dataBool = new Dictionary<string, bool>();
            //dataEdge = new Dictionary<string, string>();

            //spaces = new SkillSpace[1] { new SkillSpace() };
        }
    }

    [Serializable]
    public class SkillSpace
    {
        public string id;
        public int trigger;
        public int global;
        public string beginAction;
        public Dictionary<string, SkillNode> actions;

        [JsonIgnore]
        public Dictionary<string, int> dataInt;

        [JsonIgnore]
        public Dictionary<string, string> dataString;

        [JsonIgnore]
        public Dictionary<string, bool> dataBool;

        [JsonIgnore]
        public Dictionary<string, string> dataEdge;

        public SkillSpace()
        {
            actions = new Dictionary<string, SkillNode>();
            dataInt = new Dictionary<string, int>();
            dataString = new Dictionary<string, string>();
            dataBool = new Dictionary<string, bool>();
            dataEdge = new Dictionary<string, string>();
        }
    }

    [Serializable]
    public class SkillNode
    {
        public string id;
        public string type;
        public float x;
        public float y;
        public Dictionary<string, string> dataKey;

        public SkillNode()
        {
            dataKey = new Dictionary<string, string>();
        }
    }
}